package config

import (
	"common/helper"
	"database/sql"
)

/*
流水返利配置
*/

type CfgLostReturnItem struct {
	Running    float64 `json:"Running" db:"Running" cbor:"Running"`
	ReturnRate int     `json:"return_rate" db:"return_rate" cbor:"return_rate"`
}
type CsLostReturnCfg struct{}

var cfgLostList []CfgLostReturnItem

func (that *CsLostReturnCfg) GetCfg() []CfgLostReturnItem {
	return cfgLostList
}

func LostReturnSetRow(rows *sql.Rows) {
	var tVal CfgLostReturnItem
	var err error
	err = rows.Scan(&tVal.Running, &tVal.ReturnRate)
	if err != nil {
		helper.InfoLog("LostReturnSetRow,scan err")
		return
	}
	cfgLostList = append(cfgLostList, tVal)
}

func LostReturnRemove() {
	cfgLostList = []CfgLostReturnItem{}
}
